package com.doraemon.mapper;

import com.doraemon.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;
import java.util.List;

/**
 * 订单明细管理Mapper
 **/
@Mapper
public interface OrderDetailMapper {

    /***
     * 根据 订单明细集合 批量插入数据
     * ---
     * @param list 订单明细集合
     * @return: void
     */
    void insertBatch(ArrayList<OrderDetail> list);

    /***
     * 根据 订单id 获取订单明细集合数据
     * ---
     * @param ordersId 订单id
     * @return: java.util.List<com.doraemon.entity.OrderDetail>
     */
    @Select("select * from order_detail where order_id = #{ordersId}")
    List<OrderDetail> getByOrderId(Long ordersId);
}
